﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Module_Basic_Entities;

namespace Module_Persistence
{
    internal class TileCustomContentTypeReader : ContentTypeReader
    {
     

        public TileCustomContentTypeReader(Type targetType)
            : base(targetType)
        {

        }

        protected override object Read(ContentReader input, object existingInstance)
        {
            Tile tile = new Tile();

            tile.Walkable = input.ReadBoolean();
            tile.Triggable = input.ReadBoolean();
            tile.Id = input.ReadInt32();
            tile.Width = input.ReadInt32();
            tile.Height = input.ReadInt32();
            tile.TriggerType = input.ReadInt32();

            return tile as object;
        }
    }
}
